<?php
/**
 * @fileoverview    宝贝滚动加载接口
 * @author          zhanglei11
 * @date            Feb  02 11:31:49 CST 2012
 * @copyright       sina meila
 */

include_once '../../__global.php';
include_once 'scroll_public.php';

class aj_friendGoods extends scroll_public{

    private function set_model(){
        $this->_model = new ml_model_dbUserfeed();//模型待定等胡鸿
        $this->_dataType=array(2,3,5);    //2:宝贝  3：图片    5：转发图片
        
    }
    
    function main(){
        
        $begin = ($this->_pagenum * ML_FEED_PAGESIZE * 3) + $this->_offset * ML_FEED_PAGESIZE;
        
        $this->set_model();
        $uid = $this->__owner['uid'];
        $uids = $this->_model->getFriendIdsByUid($uid);
        
        if($this->_dataType=='all')
          $rs = $this->_model->getList($uids,$begin,ML_FEED_PAGESIZE);//第一个数据页数，第二个offset，第三个参数数据类型
        else
          $rs = $this->_model->getList($uids,$begin,ML_FEED_PAGESIZE,$this->_dataType);
        
        if($rs === false) $this->api_output(ML_RCODE_BUSY , '' , ML_RMESSAGE_BUSY);     //系统忙
        else {
            $data = $this->_model->get_data();
            $this->api_output(ML_RCODE_SUCC,$data);  //成功
        }
        
        
    }
}
new aj_friendGoods();
?>